package com.itheima.behaviour.controller;
import com.itheima.behaviour.dto.UnLikesBehaviorDto;
import com.itheima.behaviour.pojo.ApUnlikesBehavior;
import com.itheima.behaviour.service.ApUnlikesBehaviorService;
import com.itheima.common.pojo.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import com.itheima.core.controller.AbstractCoreController;

/**
* <p>
* APP不喜欢行为表 控制器</p>
* @author 作者
* @since 2021-08-30
*/
@RestController
@RequestMapping("/apUnlikesBehavior")
public class ApUnlikesBehaviorController extends AbstractCoreController<ApUnlikesBehavior> {

    private ApUnlikesBehaviorService apUnlikesBehaviorService;

    //注入
    @Autowired
    public ApUnlikesBehaviorController(ApUnlikesBehaviorService apUnlikesBehaviorService) {
        super(apUnlikesBehaviorService);
        this.apUnlikesBehaviorService=apUnlikesBehaviorService;
    }

    /**
     * 不喜欢的行为
     */
    @PostMapping(value = "/unlike")
    public Result unlikes(@RequestBody UnLikesBehaviorDto dto){
        apUnlikesBehaviorService.unlikes(dto);
        return Result.ok();
    }
}

